/*
 * Copyright (C) 2007 Eskil Bylund
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

namespace DCSharp.Hashing
{
	public partial class HashStore
	{
		/// <summary>
		/// Holds <see cref="HashTree"/> metadata.
		/// </summary>
		protected class HashInfo
		{
			private string type;
			private long index;
			private long blockSize;
			private long size;
			private string root;

			public HashInfo(long index, long blockSize, long size, string root)
				: this()
			{
				this.index = index;
				this.blockSize = blockSize;
				this.size = size;
				this.root = root;
			}

			public HashInfo()
			{
				type = "TTH";
			}

			#region Properties

			public string Type
			{
				get { return type; }
				set { type = value; }
			}

			public long Index
			{
				get { return index; }
				set { index = value; }
			}

			public long BlockSize
			{
				get { return blockSize; }
				set { blockSize = value; }
			}

			public long Size
			{
				get { return size; }
				set { size = value; }
			}

			public string Root
			{
				get { return root; }
				set { root = value; }
			}

			#endregion
		}
	}
}
